package com.xcity.game.task.detector;

import com.xcity.db.entity.Player;
import com.xcity.game.task.Task;
import com.xcity.game.task.TaskDetector;
import com.xcity.game.task.TaskDetectorLabel;

/**
 * <pre>
 * 获得宠物
 * 1个参数:
 * 1.宠物个数
 * </pre>
 * @author yang.li
 *
 */
@TaskDetectorLabel(TaskDetector.GET_PET)
public class GetPetTaskDetector implements TaskDetector {

	static final String KEY = String.valueOf(GET_PET);
	
	@Override
	public boolean isFinish(Task task) {
		int n = task.getTemplate().getConditions()[0];
		return task.getVm().getOwner().getPets().getPets().size() >= n;
	}

	@Override
	public void onArchive(Task task, Object... vals) {
	}

}
